<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/25 0025
 * Time: 17:26
 */

namespace app\jointly\controller;


class Wxlogin extends Base
{
    protected $appid = 'wxb598cf50e9fdcb41';
    protected $secret = 'de6cc5c823c478775803f432598b192e';
    protected $token;



    public function GetUserInfo($code){

        $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=$this->appid&secret=$this->secret&code=$code&grant_type=authorization_code";

        $ref = json_decode($this->cUrl($url));

        $url = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID";

        $res = json_decode($this->cUrl($url));


    }
}